package com.coocaa.ops.plus.dashboard.v1.codegen.model;

import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
import com.coocaa.ops.common.tool.json.JsonUtil;
import com.coocaa.ops.plus.dashboard.v1.codegen.convert.ColumnListConvert;
import lombok.Data;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * @author : bijiahao
 * @date : 2019/4/19.
 * @description:
 */
@Data
public class ColumnConfigModel {

    private String columnName;

    private String fieldName;

    private String javaType;

    private DbColumnType columnType;

    private String comment;

    private String key;

    private boolean keyFlag;


    public static void main(String[] args) {
        long start0 = System.currentTimeMillis();

        List<ColumnConfigModel> list = new LinkedList<>();

        ColumnConfigModel model = new ColumnConfigModel();
        model.setColumnName("flag");
        ColumnConfigModel model2 = new ColumnConfigModel();
        model2.setColumnName("last_update_date");
        List<ColumnConfigModel> list2 = new ArrayList<>(2);
        list2.add(model);
        list2.add(model2);
        list = ColumnListConvert.convertNotExistColumnList(list2);
        long end0 = System.currentTimeMillis();
        System.out.println("===操作耗时： " + (end0 - start0) / 1000.0);
        System.out.println(JsonUtil.obj2Json(list));
    }
}
